package com.kstech.test.wqc;

import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.kstech.test.wqc.fragment.DatashowFragment;
import com.kstech.test.wqc.fragment.RecyclerDataFragment;
import com.kstech.test.wqc.utils.AppContext;
import com.kstech.test.wqc.utils.DeviceModelFile;

public class MainActivity extends AppCompatActivity {

    private LinearLayout llAbove;
    private DatashowFragment df;
    private RecyclerDataFragment rdf;
    private FragmentManager fm ;
    private FragmentTransaction trans;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        llAbove = (LinearLayout) findViewById(R.id.ll_above);
        llAbove.setVisibility(View.GONE);
        df = new DatashowFragment();
        rdf = new RecyclerDataFragment();
        fm = getFragmentManager();
        trans = fm.beginTransaction();
        trans.replace(R.id.ll_data_show,df,"df");
        trans.replace(R.id.ll_data_get,rdf,"rdf");
        trans.commit();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Globals.values.clear();
    }
}
